package com.java2_7;

import org.w3c.dom.ls.LSOutput;

public class Student {

    //静态成员变量和实例成员变量
    //实例成员变量
    private String name;
    private int age;
    //静态成员变量
    public static int luckNumber = 0; //只会存储一份，并且可以通用

    public static void main(String[] args) {
        System.out.println(luckNumber);  //在同一个class下
        System.out.println(Student.luckNumber);
        Student s = new Student();
        System.out.println(s.luckNumber);
//        System.out.println(name);
//        System.out.println(age);
        Student stu = new Student();
        stu.name = "zhangsan";
        System.out.println(stu.name);

    }

    public Student() {

    }

    public Student(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }
}
